
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=utf-8" %>
<%@page import="controller.Controller"%>
<%@page import="sessionMenegment.SessionMgr"%>
<%@ page import="java.util.*,dataBase.*"%>
<%@page import="language.LangFactory"%>
<%@page import="language.LangIntrf"%>
<%
	LangFactory langFactory= new LangFactory();
	String langName = request.getParameter("lang");

	LangIntrf lang =null;
	if(langName!=null){
		lang = langFactory.getLang(request.getParameter("lang"));
		session.setAttribute("lang",langName);
	}
	else
		lang = langFactory.getLang((String)session.getAttribute("lang"));
	String langSign = lang.getLang();
	
	
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Synca</title>
<link rel="icon" href="images/synca.png" type="image/x-icon"/> 
<link rel="shortcut icon" href="images/synca.png" type="image/x-icon"/>
<link href="try4.css" rel="stylesheet" type="text/css" />

<!--[if IE]>

<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.twoColHybLtHdr #sidebar1 { padding-top: 30px; }
.twoColHybLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it may need to avoid several bugs */
</style>
<![endif]-->


<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="javascript/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="javascript/jquery.tools.min.js"></script>
<script type="text/javascript" src="javascript/jquery-ui-1.7.1.custom.min.js"></script>
<script type="text/javascript" src="javascript/jquery.address-1.4.min.js"></script>
<script type="text/javascript" src="javascript/jquery.js"></script>
<script type="text/javascript" src="javascript/interface.js"></script>
<script type="text/javascript" src="javascript/jquery.validate.js"></script>
<script src="javascript/jpicker-1.1.6.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.zaccordion.min.js"></script>
<%
	String orderNum = request.getParameter("orderNum");
	String bizName = request.getParameter("bizName");
	String phone = request.getParameter("phone");
	if(orderNum==null || bizName==null || phone==null || orderNum.equals("") || bizName.equals("") || phone.equals(""))
		response.sendRedirect("home.jsp");
	Controller controller = Controller.getInstance();
%>


<script>

			jQuery(document).ready(
				function() {

					jQuery(function($) { $('#myAccordion').Accordion({
						headerSelector	: 'dt',
						panelSelector	: 'dd',
						activeClass		: 'myAccordionActive',
						hoverClass		: 'myAccordionHover',
						panelHeight		: 285,
						speed			: 300
						}); 
						$('#myAccordion').Accordion
					});
					 $("#logOut").click(function(){
							$.post("logOutBusiness",function(){$(location).attr('href','home.jsp');});
					});
					 $("#profile").click(function(){
							$.post("myProfileBusiness",function(){$(location).attr('href','myProfileBusiness2.jsp');});
					    });
				}				
			);				 
		</script>
	<script language="JavaScript">
		<!--
		function calcHeight()
		{
		  //find the height of the internal page
		  var the_height=
		    document.getElementById('orderFrame').contentWindow.
		      document.body.scrollHeight;
		
		  //change the height of the iframe
		  document.getElementById('orderFrame').height=
		      the_height;
		}
		//-->
	</script>
</head>

<body class="twoColHybLtHdr">

<div id="container">
  <div id="header">
		<div id="logo">
        	<a href="home.jsp"><img src="images\logo.png" alt="" height="80px"/></a>
        </div>    		

            
</div>
  <div id="sidebar1">
    <div class="accordionDiv">
    	<dl id="myAccordion">
            <dt class="someClass" style="text-align: <%=lang.getAlign()%>"><%=lang.getSIGNIN_LABEL() %></dt>
            <dd id="signIn"><br/>
                <form id="signIn" action="logIn" method="post" accept-charset="ISO-8859-1">
                    <%-- <label> User Name:</label>
                    <input type="text" name="username" />
                    <label> Password:</label>
                    <input type="password" name="password" />
                    <input id="type" name="type" type="hidden" value="customer"/>
                    <h5><%String s = (String)session.getAttribute("error");
                    	  if(s!=null){
                    		  session.setAttribute("error",null);
                    		  out.println(s);
                    	  }  
                    	   %></h5>
                    <input type="checkbox" name="remember" class="check">Remember Me</input> 
                    <center><button type="submit">Log In</button></center> --%>
                    <input id="type" name="type" type="hidden" value="customer"/>
                	<table width="80%">
                        <tr><td align="<%=lang.getAlign()%>"><%=lang.getUSERNAME_LABEL() %></td></tr>
                		<tr><td align="<%=lang.getAlign()%>"><input type="text" name="username" /></td></tr>
                		<tr><td align="<%=lang.getAlign()%>"><%=lang.getPASSWORD_LABEL() %></td></tr>
                		<tr><td align="<%=lang.getAlign()%>"><input type="password" name="password" /></td></tr>
                		<tr><td align="<%=lang.getAlign()%>"><%String s = (String)session.getAttribute("error");
                    	  if(s!=null){
                    		  session.setAttribute("error",null);
                    		  out.println(s);
                    	  }  
                    	   %></td></tr>
                    	   <%
                    	   if(lang.getAlign().equals("left")){
                    	   %>
                			<tr><td align="left"><input type="checkbox" name="remember" class="check"><%=lang.getREMEMBER_ME_LABEL() %></input> </td></tr>
                			<tr><td align="right"><button type="submit"><%=lang.getLOG_IN_BUTTON() %></button></td></tr>
                			<%}else{ %>
                			<tr><td align="right"><%=lang.getREMEMBER_ME_LABEL() %><input type="checkbox" name="remember" class="check"></input> </td></tr>
                			<tr><td align="left"><button type="submit"><%=lang.getLOG_IN_BUTTON() %></button></td></tr>
                			<%} %>
							
                	</table>
                    
                    <a href="#forget"><h4><%=lang.getFORGOT_PASSWORD_LABEL() %></h4></a>
                 
                </form>
                <a href="gmailLogin"><img src="images/loginGoogle-<%=lang.getLang()%>.png"/></a>
            </dd>

            <dt class="someClass" style="text-align: <%=lang.getAlign()%>"><%=lang.getFIND_ORDER_LABEL() %></dt>
            <dd><br/>
                <form id="FindOrder" action="showOneOrder.jsp" method="get" target="_blank"  accept-charset="ISO-8859-1">
                    <%-- <label> Company Name:</label>
                    <select name="bizName" >
                    <%Controller controller = Controller.getInstance();
                      ArrayList<String> bizNameList = controller.allBizNameArray();
                      ArrayList<String> bizUserList = controller.allBizUserNameArray();
                      if(bizNameList==null || bizUserList==null){
                    	  System.out.println("error!!!!!!!!!!");
                    	  System.out.println(bizNameList);
                    	  System.out.println(bizUserList);

                      }
                      for(int i=0;i<bizNameList.size();i++){
                    %>
                        <option value="<%=bizUserList.get(i)%>"><%=bizNameList.get(i)%></option>
                    <%} %>
                    </select><br />
                    <label> Order Number:</label>
                    <input type="text" name="orderNum" /><br/>
                    <label> Phone Number:</label>
                    <input type="text" name="phone" />
                    <h5>
                    </h5>
                    
                    <center><button type="submit">Find</button></center> --%>
                    <table>
                		<tr><td align="<%=lang.getAlign()%>"><%=lang.getCOMPANY_NAME_LABEL() %></td></tr>
                		<tr><td align="<%=lang.getAlign()%>"><select name="bizName" >
                    <%
                      ArrayList<String> bizNameList = controller.allBizNameArray();
                      ArrayList<String> bizUserList = controller.allBizUserNameArray();
                      if(bizNameList==null || bizUserList==null){
                    	  System.out.println("error!!!!!!!!!!");
                    	  System.out.println(bizNameList);
                    	  System.out.println(bizUserList);

                      }
                      for(int i=0;i<bizNameList.size();i++){
                    %>
                        <option value="<%=bizUserList.get(i)%>"><%=bizNameList.get(i)%></option>
                    <%} %>
                    </select></td></tr>
                    <tr><td align="<%=lang.getAlign()%>"><%=lang.getORDER_NUBER_LABEL() %></td></tr>
                    <tr><td align="<%=lang.getAlign()%>"><input type="text" name="orderNum" /></td></tr>
                    <tr><td align="<%=lang.getAlign()%>"><%=lang.getPHONE_NUMBER_LABEL() %></td></tr>
                    <tr><td align="<%=lang.getAlign()%>"><input type="text" name="phone" /></td></tr>
                    <%if(lang.getAlign().equals("left")){ %>
                    	<tr><td align="right"><button type="submit"><%=lang.getFIND_BUTTON() %></button></td></tr>
                    <%}else{ %>
                    	<tr><td align="left"><button type="submit"><%=lang.getFIND_BUTTON() %></button></td></tr>
                    <%} %>
                	</table>
                	<h5></h5>
                </form>
            </dd>
            
        </dl>
    </div>    
</div>
  <div id="mainContent">
    <div id="home">
    	<iframe src="showOrdersSynca.jsp?bizName=<%=bizName %>&orderNum=<%= orderNum%>&phone=<%=phone %>" frameborder="0" width="600" height="300" id="orderFrame" onLoad="calcHeight();" ></iframe>
    </div>
				

</div>
	<br class="clearfloat" />
	
</div>
<div id="footer">
    <a href="showOneOrder.jsp?lang=he&bizName=<%=bizName %>&orderNum=<%= orderNum%>&phone=<%=phone %>"><img src="../images/hebrew.gif" width="30px" style="float: left; margin-top: 0.5%; margin-left: 0.5%;"/></a>
	<a href="showOneOrder.jsp?lang=en&bizName=<%=bizName %>&orderNum=<%= orderNum%>&phone=<%=phone %>"><img src="../images/english.gif" width="30px" style="float: left; margin-top: 0.5%;margin-left: 0.5%;"/></a>
    <p><%=lang.getCOPY_RIGHT_LABEL() %></p>
    
 </div>
</body>
</html>
